package com.dancun.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dancun.entity.CTask;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2020-10-02
 */
@Mapper
public interface CTaskMapper extends BaseMapper<CTask> {

    @Results(id = "ctaskMap", value = {
            @Result(property = "taskId", column = "taskId"),
            @Result(property = "startDate", column = "startDate"),
            @Result(property = "endDate", column = "endDate"),
            @Result(property = "tname", column = "tname"),
            @Result(property = "content", column = "content"),
            @Result(property = "cid", column = "cid"),
            @Result(property = "course", column = "cid", one = @One(select = "com.dancun.mapper.CourseMapper.selectById"))
    })

    @Select("select * from c_task t inner join course c on c.cid=t.cid")
//    @ResultMap(value="ctaskMap")
    List<CTask> list(CTask cTask);

}
